Ordinary Differential Equation Solve Blocks

Odesolve([vector], x, b, [npoints]) Returns the solution to an ordinary differential equation (ODE), subject to initial value or boundary value constraints. The ODE must be linear in its highest derivative term, and the number of initial and boundary conditions must equal the order(s) of the ODE(s). To use Odesolve, create a solve block that ends with the Odesolve command.

Arguments:

Odesolve returns the solution as a function of the independent variable. To evaluate this function, Odesolve saves solutions at npoints equally spaced points in the integration interval, and then interpolates between those points using the function lspline.

Note: The larger the value of npoints, the more accurate the interpolated solution function is. Usually, the default value of npoints is sufficient to obtain good results, but if you are solving the ODE over a large interval, set npoints to a value larger than the default.

Example:

To solve the ODE

y″ + 3y = 0

subject to the initial conditions

y(0) = 1, y′(0) = 2

create the following solve block, using Boolean equals ([Ctrl] [=]) in the differential equation and initial conditions. To insert the derivative symbols for y′ and y″, press [Ctrl] [F7].

ODE defined by a solve block

The solution y is a function of the variable x specified by the first argument to Odesolve. The graph of the solution is shown below:

graph of the solution of Odesolve example

Algorithms:

You can choose the method for solving the ODE by right-clicking on Odesolve in the solve block and selecting one of the following from the drop-down menu:

Radau is the only method that solves systems with algebraic constraints. If your system has such constraints, Odesolve automatically uses the Radau algorithm, regardless of your selection from the drop-down menu.

Notes:

QuickSheet - Solving First-Order ODEs
QuickSheet - Solving a First-Order System of ODEs
QuickSheet - Simple Pendulum Motion

Related Topics